﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Model.WorkBill
{
    /// <summary>
    /// 工作单
    /// </summary>
    public class WorkBill : Entity
    {
        #region 数据表名称
        public static readonly string TableName = "WorkBill";
        #endregion

        #region 字段
        /// <summary>
        /// 工作单类型
        /// </summary>
        public virtual WorkBillType BillType { get; set; }

        /// <summary>
        /// 工作单发起人
        /// </summary>
        public virtual DB_Model.ywxt.t_sys_user Creator { get; set; }

        /// <summary>
        /// 工作单执行部门
        /// </summary>
        public virtual DB_Model.ywxt.t_sys_department ExecuteDepartment { get; set; }

        /// <summary>
        /// 工作单执行人（最终执行人，既工作单流程结束者）
        /// </summary>
        public virtual DB_Model.ywxt.t_sys_user Executor { get; set; }

        /// <summary>
        /// 工作事项，多选，按逗号分隔
        /// </summary>
        public virtual string BillItems { get; set; }

        /// <summary>
        /// 工作内容
        /// </summary>
        public virtual string BillContent { get; set; }

        /// <summary>
        /// 工作单所属项目
        /// </summary>
        public virtual DB_Model.ywxt.t_project Project { get; set; }

        /// <summary>
        /// 要求完成时间
        /// </summary>
        public virtual DateTime WillEndDate { get; set; }

        /// <summary>
        /// 工作单结束状态：
        /// -1：审核不通过
        /// 1：执行中
        /// 99：完成
        /// </summary>
        public virtual int EndFlag { get; set; }

        /// <summary>
        /// 工作单结束时间
        /// </summary>
        public virtual DateTime EndDate { get; set; }

        /// <summary>
        /// 工作单描述
        /// </summary>
        public virtual string EndDescribe { get; set; }

        /// <summary>
        /// 工作单处理流程
        /// </summary>
        public virtual IList<WorkBillFlow> Flows { get; set; }

        /// <summary>
        /// 工作单评价
        /// </summary>
        public virtual IList<WorkBillEvaluate> Evaluates { get; set; }

        /// <summary>
        /// 当前工作单对应的审批记录ID
        /// </summary>
        public virtual string ApprovalRecordId { get; set; }
        #endregion

        public WorkBill()
        {
            Evaluates = new List<WorkBillEvaluate>();
            Flows = new List<WorkBillFlow>();
        }
    }
}
